/**
* @Author:wjp
* @Date:2019/10/29 1:34 下午
 */
package utils

import (
	"encoding/hex"
	"golang.org/x/crypto/scrypt"
)

//密码加密
func MakePassword(username, password string) (str string, err error) {
	dk, err := scrypt.Key([]byte(password), []byte(username), 32768, 8, 1, 32)
	encodedStr := hex.EncodeToString(dk)
	if err != nil {
		return "", err
	}
	return encodedStr, nil
}
